<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh-CN" xml:lang="zh-CN">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="js/jquery.js"></script>
<script>
	$(document).ready(function() {
		$("form#proccess").submit(function(){
			
			$("#state").ajaxStart(
				function(){
				$(this).html("<b>loading</b>");

					}
				).ajaxStop(
				function(){
					$(this).unbind("ajaxStart");
				});
			
			
			
				if($('#chapter_url').val()=='' ||$('#type').value=='') {
					//$("#state").html('<b>字段不能为空</b>'); 
				//	console.log($('input[@value=""]').attr('id'));//.focus();
					//return false;
					}
					//var proccessUrl  = $("#proccess").attr('action')	;
					proccessUrl = "ajaxProccessUrl.php"
					$.post(proccessUrl,$(this).find('input').serialize(),function(data){

					console.log(data);								
					
					var html;
					html = (data.state <= 0 )?(data.erorr):'<a href = '+data.url+'>点击下载</a>'; 
					$('#state').html(html);
					
				},'json');
				return false;
			});		
	});
		
</script>
<title>易读 打包程序 | by Falcon</title>
</head>
<body>
	<h1>易读 打包程序</h1>
	<form id="proccess" action="proccess.php" method="post" enctype="application/x-www-form-urlencoded">
    <label>请输入作品链接地址：
    <input id ="chapter_url"  name="chapter_url" type="text" size="50" value="http://www.yi-look.com/art_9734_1585.html"/><br />
    </label>
    
    
    
    <label>请选择下载格式：
    <input id = 'type' name="type" type="radio" value="txt" />
    <label>文本格式(.txt)</label>
    
    <input name="type" type="radio" checked="checked" value="zip" />
    <label>Zip压缩包(.txt)</label>
    </label>

      <input type="submit" name="submit" id="send" value="提交" />
	
	</form>
	<div id="state">状态 </div>
</body>
</html>